<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../../../common/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<sfa:mainTitle></sfa:mainTitle>
		<%@ include file="../../../common/meta.jsp"%>
		<script type="text/javascript">
$(function() {
	//设置表单验证
	var addForm = $("#addForm").validate( {
		rules : {
			trainerName : {
				required : true,
				rangelength : [ 2, 20 ]
			}
		}
	});
	//提交
	$("#btn_submit")
			.click(
					function() {
						if (addForm.form()) {
							art.dialog( {
								id : "loading",
								lock : true,
								drag : false,
								resize : false,
								title : "正在提交..."
							});

							$("#addForm")
									.ajaxSubmit(function(result) {
										art.dialog( {
											id : 'loading'
										}).close();//关闭等待框

											if (result == "true") {
												art
														.dialog( {
															content : "修改成功!",
															lock : true,
															ok : function() {
																location.href = "${path}/productandtrain/lecturer/index/trainer";
															},
															cancelVal : '关闭',
															cancel : true
														});
											} else {
												art.dialog( {
													content : "修改失败!",
													lock : true,
													ok : true
												});
											}
										});
						}
					});
});
</script>
	</head>
	<body id="master">
		<sfa:mainHeader></sfa:mainHeader>
		<div class="webpart3 contentarea">
			<div class="webpart-head">
				<div class="webpart-head-item">
					修改讲师
				</div>
			</div>
			<div class="webpart-main">
				<div class="webpart-main-item" style="padding: 15px;">
					<form id="addForm"
						action="${path}/productandtrain/lecturer/index/edittrainer" method="post">
						<div class="d_formitem">
							<table cellspacing="0" cellpadding="0" class="formitem">
								<tr>
									<td width="20%">
										<span>所属机构：</span>
									</td>
									<td>
									<select class="selectbox" name="branchId" id="branchId">
										<c:forEach items="${BranchList}" var="branch">
											<option value="${branch.branchId }"
												<c:if test="${model.branchId==branch.branchId }">selected='selected'</c:if>>
												${branch.branchName}
											</option>
										</c:forEach>
									</select>
								</td>
								</tr>
								<tr>
									<td>
										<span>讲师姓名：</span>
									</td>
									<td>
										<input type="text" id="trainerName" name="trainerName"
											class="input-txt" maxlength="20" value="${model.trainerName}"
											tyle="width: 120px;" />
									</td>
								</tr>
								<tr>
									<td>
										<span>职&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;级：</span>
									</td>
									<td>
									<c:if test="${model.trainerType == 'TRAINERTYPE_A'}">
										<sfa:dic showType="select" kindNo="TRAINERLEVEL"
											attr="class='selectbox'" name="trainerLevel"
											id="trainerLevel"></sfa:dic>
									</c:if>	
									<c:if test="${model.trainerType == 'TRAINERTYPE_B'}"> 
										<sfa:dic showType="select" kindNo="TRAINERGRADE"
											attr="class='selectbox'" name="trainerLevel"
											id="trainerLevel" ></sfa:dic>
									</c:if>		
									</td>
								</tr>
								<tr>
									<td>
										<span>擅长课程：</span>
									</td>
									<td>
										<input type="text" class="input-txt" id="goodAtItem"
											name="goodAtItem" value="${model.goodAtItem}"
											tyle="width: 120px;" />

										</div>
									</td>
								</tr>
								<tr>
									<td>
									</td>
									<td>
										<input type="button" id="btn_submit" tabindex="5"
											class="linkbtn2" value="保存">
											<input type="button" id="btn_submit" tabindex="5"
											class="linkbtn2" value="返回" onclick="location.href='${path}/productandtrain/lecturer/index/trainer';">
										&nbsp;&nbsp;
										 
										<input type="hidden" id="SaleTrainerId" name="SaleTrainerId"
											value="${trainerid}" />
									</td>
								</tr>
							</table>
						</div>
					</form>
				</div>
				<div class="webpart-foot">
					<div class="webpart-foot-item">
					</div>
				</div>
			</div>
		</div>
		<sfa:mainFooter></sfa:mainFooter>
	</body>
</html>